\(\int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx\) [136]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 86 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=-\frac {\frac {1}{b}+\frac {b}{a^2}}{2 d (b+a \cot (c+d x))^2}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{d (b+a \cot (c+d x))}+\frac {\log (b+a \cot (c+d x))}{b^3 d}+\frac {\log (\tan (c+d x))}{b^3 d} \]

[Out]

1/2*(-1/b-b/a^2)/d/(b+a*cot(d*x+c))^2+(1/a^2-1/b^2)/d/(b+a*cot(d*x+c))+ln(b+a*cot(d*x+c))/b^3/d+ln(tan(d*x+c))
/b^3/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {3167, 908} \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {\frac {1}{a^2}-\frac {1}{b^2}}{d (a \cot (c+d x)+b)}-\frac {\frac {b}{a^2}+\frac {1}{b}}{2 d (a \cot (c+d x)+b)^2}+\frac {\log (a \cot (c+d x)+b)}{b^3 d}+\frac {\log (\tan (c+d x))}{b^3 d} \]

[In]

Int[Sec[c + d*x]/(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

-1/2*(b^(-1) + b/a^2)/(d*(b + a*Cot[c + d*x])^2) + (a^(-2) - b^(-2))/(d*(b + a*Cot[c + d*x])) + Log[b + a*Cot[
c + d*x]]/(b^3*d) + Log[Tan[c + d*x]]/(b^3*d)

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 3167

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[-d^(-1), Subst[Int[x^m*((b + a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1+x^2}{x (b+a x)^3} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {1}{b^3 x}+\frac {-a^2-b^2}{a b (b+a x)^3}+\frac {-a^2+b^2}{a b^2 (b+a x)^2}-\frac {a}{b^3 (b+a x)}\right ) \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\frac {1}{b}+\frac {b}{a^2}}{2 d (b+a \cot (c+d x))^2}+\frac {\frac {1}{a^2}-\frac {1}{b^2}}{d (b+a \cot (c+d x))}+\frac {\log (b+a \cot (c+d x))}{b^3 d}+\frac {\log (\tan (c+d x))}{b^3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.60 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.66 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {\log (a+b \tan (c+d x))-\frac {a^2+b^2}{2 (a+b \tan (c+d x))^2}+\frac {2 a}{a+b \tan (c+d x)}}{b^3 d} \]

[In]

Integrate[Sec[c + d*x]/(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]

[Out]

(Log[a + b*Tan[c + d*x]] - (a^2 + b^2)/(2*(a + b*Tan[c + d*x])^2) + (2*a)/(a + b*Tan[c + d*x]))/(b^3*d)

Maple [A] (verified)

Time = 1.04 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.73

method result size
derivativedivides \(\frac {\frac {\ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}-\frac {a^{2}+b^{2}}{2 b^{3} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {2 a}{b^{3} \left (a +b \tan \left (d x +c \right )\right )}}{d}\) \(63\)
default \(\frac {\frac {\ln \left (a +b \tan \left (d x +c \right )\right )}{b^{3}}-\frac {a^{2}+b^{2}}{2 b^{3} \left (a +b \tan \left (d x +c \right )\right )^{2}}+\frac {2 a}{b^{3} \left (a +b \tan \left (d x +c \right )\right )}}{d}\) \(63\)
risch \(\frac {-2 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 a^{2}-2 i b a}{b^{2} \left (i a +b \right ) \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{2} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{3} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{3} d}\) \(160\)
norman \(\frac {-\frac {2 \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{2} d a}+\frac {2 \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{b^{2} d a}-\frac {2 \left (3 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a^{2} b d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{b^{3} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{3} d}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{3} d}\) \(205\)
parallelrisch \(\frac {\left (\left (2 a^{2}-2 b^{2}\right ) \cos \left (2 d x +2 c \right )+4 a b \sin \left (2 d x +2 c \right )+2 a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )+\left (\left (-2 a^{2}+2 b^{2}\right ) \cos \left (2 d x +2 c \right )-4 a b \sin \left (2 d x +2 c \right )-2 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+\left (\left (-2 a^{2}+2 b^{2}\right ) \cos \left (2 d x +2 c \right )-4 a b \sin \left (2 d x +2 c \right )-2 a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (a^{2}+b^{2}\right ) \cos \left (2 d x +2 c \right )+a^{2}-3 b^{2}}{2 \left (\left (a^{2}-b^{2}\right ) \cos \left (2 d x +2 c \right )+2 a b \sin \left (2 d x +2 c \right )+a^{2}+b^{2}\right ) b^{3} d}\) \(268\)

[In]

int(sec(d*x+c)/(cos(d*x+c)*a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/b^3*ln(a+b*tan(d*x+c))-1/2*(a^2+b^2)/b^3/(a+b*tan(d*x+c))^2+2*a/b^3/(a+b*tan(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 284 vs. \(2 (84) = 168\).

Time = 0.28 (sec) , antiderivative size = 284, normalized size of antiderivative = 3.30 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {4 \, a^{2} b^{2} \cos \left (d x + c\right )^{2} - 3 \, a^{2} b^{2} - b^{4} - 2 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - {\left (a^{2} b^{2} + b^{4} + {\left (a^{4} - b^{4}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right )}{2 \, {\left ({\left (a^{4} b^{3} - b^{7}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} b^{4} + a b^{6}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} b^{5} + b^{7}\right )} d\right )}} \]

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

1/2*(4*a^2*b^2*cos(d*x + c)^2 - 3*a^2*b^2 - b^4 - 2*(a^3*b - a*b^3)*cos(d*x + c)*sin(d*x + c) + (a^2*b^2 + b^4
 + (a^4 - b^4)*cos(d*x + c)^2 + 2*(a^3*b + a*b^3)*cos(d*x + c)*sin(d*x + c))*log(2*a*b*cos(d*x + c)*sin(d*x +
c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2) - (a^2*b^2 + b^4 + (a^4 - b^4)*cos(d*x + c)^2 + 2*(a^3*b + a*b^3)*cos(d
*x + c)*sin(d*x + c))*log(cos(d*x + c)^2))/((a^4*b^3 - b^7)*d*cos(d*x + c)^2 + 2*(a^3*b^4 + a*b^6)*d*cos(d*x +
 c)*sin(d*x + c) + (a^2*b^5 + b^7)*d)

Sympy [F]

\[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\int \frac {\sec {\left (c + d x \right )}}{\left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{3}}\, dx \]

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))**3,x)

[Out]

Integral(sec(c + d*x)/(a*cos(c + d*x) + b*sin(c + d*x))**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 315 vs. \(2 (84) = 168\).

Time = 0.24 (sec) , antiderivative size = 315, normalized size of antiderivative = 3.66 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (\frac {{\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {{\left (3 \, a^{2} b - b^{3}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{4} b^{2} + \frac {4 \, a^{3} b^{3} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {4 \, a^{3} b^{3} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {a^{4} b^{2} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {2 \, {\left (a^{4} b^{2} - 2 \, a^{2} b^{4}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} - \frac {\log \left (-a - \frac {2 \, b \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{b^{3}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{3}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{3}}}{d} \]

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

-(2*((a^3 - a*b^2)*sin(d*x + c)/(cos(d*x + c) + 1) + (3*a^2*b - b^3)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - (a^
3 - a*b^2)*sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/(a^4*b^2 + 4*a^3*b^3*sin(d*x + c)/(cos(d*x + c) + 1) - 4*a^3*b
^3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + a^4*b^2*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 2*(a^4*b^2 - 2*a^2*b^4)
*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) - log(-a - 2*b*sin(d*x + c)/(cos(d*x + c) + 1) + a*sin(d*x + c)^2/(cos(d
*x + c) + 1)^2)/b^3 + log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^3 + log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/
b^3)/d

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.72 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {\frac {2 \, \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{3}} - \frac {3 \, b \tan \left (d x + c\right )^{2} + 2 \, a \tan \left (d x + c\right ) + b}{{\left (b \tan \left (d x + c\right ) + a\right )}^{2} b^{2}}}{2 \, d} \]

[In]

integrate(sec(d*x+c)/(a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")

[Out]

1/2*(2*log(abs(b*tan(d*x + c) + a))/b^3 - (3*b*tan(d*x + c)^2 + 2*a*tan(d*x + c) + b)/((b*tan(d*x + c) + a)^2*
b^2))/d

Mupad [B] (verification not implemented)

Time = 26.11 (sec) , antiderivative size = 396, normalized size of antiderivative = 4.60 \[ \int \frac {\sec (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx=\frac {2\,\mathrm {atanh}\left (\frac {16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{16\,a+\frac {32\,a^3}{b^2}-16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}-\frac {16\,a}{16\,a+\frac {32\,a^3}{b^2}-16\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b^2}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,a\,b+\frac {32\,a^3}{b}+32\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {32\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{b}-16\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}\right )}{b^3\,d}-\frac {\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (3\,a^2-b^2\right )}{a^2\,b}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (a^2-b^2\right )}{a\,b^2}+\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2-b^2\right )}{a\,b^2}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2-4\,b^2\right )+a^2-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \]

[In]

int(1/(cos(c + d*x)*(a*cos(c + d*x) + b*sin(c + d*x))^3),x)

[Out]

(2*atanh((16*a*tan(c/2 + (d*x)/2)^2)/(16*a + (32*a^3)/b^2 - 16*a*tan(c/2 + (d*x)/2)^2 - (32*a^3*tan(c/2 + (d*x
)/2)^2)/b^2 + (32*a^2*tan(c/2 + (d*x)/2))/b) - (16*a)/(16*a + (32*a^3)/b^2 - 16*a*tan(c/2 + (d*x)/2)^2 - (32*a
^3*tan(c/2 + (d*x)/2)^2)/b^2 + (32*a^2*tan(c/2 + (d*x)/2))/b) + (32*a^2*tan(c/2 + (d*x)/2))/(16*a*b + (32*a^3)
/b + 32*a^2*tan(c/2 + (d*x)/2) - (32*a^3*tan(c/2 + (d*x)/2)^2)/b - 16*a*b*tan(c/2 + (d*x)/2)^2)))/(b^3*d) - ((
2*tan(c/2 + (d*x)/2)^2*(3*a^2 - b^2))/(a^2*b) - (2*tan(c/2 + (d*x)/2)^3*(a^2 - b^2))/(a*b^2) + (2*tan(c/2 + (d
*x)/2)*(a^2 - b^2))/(a*b^2))/(d*(a^2*tan(c/2 + (d*x)/2)^4 - tan(c/2 + (d*x)/2)^2*(2*a^2 - 4*b^2) + a^2 - 4*a*b
*tan(c/2 + (d*x)/2)^3 + 4*a*b*tan(c/2 + (d*x)/2)))